﻿<Dock:DockContent x:Class="Daytimer.Search.SearchControl"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
		xmlns:Dock="clr-namespace:Daytimer.DockableDialogs;assembly=Daytimer.DockableDialogs"
		xmlns:local="clr-namespace:Daytimer.Search" xmlns:System="clr-namespace:System;assembly=mscorlib"
		mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="250">
	<Dock:DockContent.Resources>
		<Style TargetType="{x:Type local:SearchableTextControl}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type local:SearchableTextControl}">
						<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
								BorderThickness="{TemplateBinding BorderThickness}">
							<TextBlock x:Name="PART_TEXT" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" />
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style TargetType="{x:Type local:SearchResultUI}" BasedOn="{StaticResource ListBoxItemStyle}" />
	</Dock:DockContent.Resources>
	<Grid Margin="0,-5,0,0">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition />
		</Grid.RowDefinitions>
		<Grid TextElement.FontSize="15">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
			<Button x:Name="filterButton" Background="Transparent" BorderBrush="Transparent" Padding="3"
					Focusable="False" MinWidth="0" Width="NaN" ToolTip="Filter search" Click="filterButton_Click">
				<Button.Content>
					<Image Stretch="None" Source="pack://application:,,,/Daytimer.Images;component/Images/search.png" />
				</Button.Content>
				<Button.Template>
					<ControlTemplate TargetType="Button">
						<Border x:Name="border" Padding="{TemplateBinding Padding}" BorderThickness="1"
								BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
							<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsMouseOver" Value="True">
								<Setter Property="Background" TargetName="border"
										Value="{DynamicResource AppointmentCloseMouseOverBackground}" />
								<Setter Property="BorderBrush" TargetName="border"
										Value="{DynamicResource AppointmentCloseMouseOverBorder}" />
							</Trigger>
							<Trigger Property="IsPressed" Value="True">
								<Setter Property="Background" TargetName="border" Value="{DynamicResource Blue}" />
								<Setter Property="BorderBrush" TargetName="border" Value="#FF555555" />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Button.Template>
			</Button>
			<TextBlock x:Name="searchBoxWatermark" Text="Search" Foreground="#FFA0A0A0" VerticalAlignment="Center"
					Margin="12,0,0,0" Grid.Column="1" TextTrimming="CharacterEllipsis" />
			<TextBox x:Name="searchBox" Padding="2" Background="Transparent" BorderThickness="0" Margin="8,0,0,0"
					Grid.Column="1" MaxLines="1" TextChanged="searchBox_TextChanged"
					PreviewKeyDown="searchBox_PreviewKeyDown" />
		</Grid>
		<TextBlock x:Name="statusText" Text="No search results." HorizontalAlignment="Center" VerticalAlignment="Top"
				Margin="0,25,0,0" Foreground="#FFB2B2B2" Grid.Row="1" />
		<ListBox x:Name="searchResults" VirtualizingStackPanel.IsVirtualizing="True"
				VirtualizingStackPanel.VirtualizationMode="Recycling" BorderThickness="0"
				ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="0,10,0,0"
				Background="{DynamicResource White}" Opacity="0" Grid.Row="1" />
	</Grid>
</Dock:DockContent>
